using System;
using System.Web;
using System.Web.UI;
using System.Xml;

/*	-----------------------------------------------------------------------	
	Copyright:	umlungu consulting (pty) ltd
	Author:		Alan Benington
	Started:	2007-05-19
	Status:		live	
	Version:	2.0.0
	Build:		20070519
	License:	GNU General Public License
	-----------------------------------------------------------------------	*/
	
/*	-----------------------------------------------------------------------	
	Development Notes:
	==================
	20070519:
	- Starting point has been iBurstFeed.updated.
	---------------------------------------------------------------------------	*/
	
namespace umlungu.engineX.blogX.TestSiteX {
	/// <summary>
	/// Description of the classX class.
	/// <para>Additional information about the class</para>
	/// </summary>
	public class TestSiteFeed {
		#region Invisible properties
		private static string name = "feedback";
		private static bool preload = true;
		#endregion

		#region Visible properties
		private HttpApplicationState application;
		#endregion

		#region Constructors/Destructors
		/// <summary>Default constructor</summary>
		public TestSiteFeed(HttpApplicationState app) {
			application = app;
		}
		#endregion

		#region Public methods
		/// <summary>
		/// Adds a tip (blog) to an element of an XmlDocument
		/// </summary>
		/// <param name="elem">The XmlElement that the tip must be appended to</param>
		/// <param name="page">The web application Page object</param>
		public void Add(Page page, XmlElement elem) {
			x_page feedback;
			XmlDocument doc = elem.OwnerDocument;
			if (preload)
				feedback = (x_page)application["FeedbackX"];
			else {
				feedback = new x_page(page);
				feedback.Load("site", "relinfo", "", "feedback");
			}
			XmlNode feedNode = elem.AppendChild(doc.CreateElement(name));
			feedNode.AppendChild(doc.ImportNode(feedback.Page, true));
		}
		#endregion
		
		#region Protected methods
		// none
		#endregion
				
		#region Private methods
		// none
		#endregion
	}
}
